package com.app.util.ant;

public abstract class Ant<T> implements Runnable {

	private T object;

	protected AntPool<T> pool;

	public abstract void service();

	public final void run() {
		try {
			service();
		} finally {
			release();
		}
	}

	private void release() {
		pool.release(this);
	}

	public T getObject() {
		return object;
	}

	void setObject(T data) {
		this.object = data;
	} 

}
